<?php

namespace app\common\model;
/**
 * [ZhSupport  答疑解惑表]
 * @author [C。]
 * @return html
 */
class ZhSupport extends Base
{
    protected $name = 'zh_support';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getlist($map,$from = 0, $size = 5,$field = '*')
    {
        $order = ['id' => 'desc'];
        $result =  $this->field($field)->order($order)->limit($from, $size)->where($map)->select();
        return $result;
    }
    /**
     * 根据搜索条件获取总条数
     */
    public function getCount($map)
    {
        $result =  $this->where($map)->count();
        return $result;
    }
    /**
     * 根据搜索条件获取列表信息
     */
    public function getlists($map,$from = 0, $size = 5,$field = '*')
    {
        $order = ['s.id' => 'desc'];
        $join = [
            ['app_member m','m.id = s.mid'],
        ];
        $result =  $this->alias('s')->join($join)->field($field)->order($order)->limit($from, $size)->where($map)->select();
        return $result;
    }
    /**
     * 根据搜索条件获取总条数
     */
    public function getCounts($map)
    {
        $join = [
            ['app_member m','m.id = s.mid'],
        ];
        $result =  $this->alias('s')->join($join)->where($map)->count();
        return $result;
    }
}